Skip to content

feat(client): let libraries append via and middleware to X-Client-Info - #376

Open
yannbf wants to merge 2 commits into
mainfrom
yannbraga/sdk-1877-client-info-library-parameters
Open

yannbf wants to merge 2 commits into
mainfrom
yannbraga/sdk-1877-client-info-library-parameters

Conversation

@yannbf

@yannbf yannbf commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

This PR adds via and middleware parameters to the X-Client-Info spec, and defines how a library built on an SDK appends them to the SDK's value:

  • via is the library's own name/version, e.g. supabase-server/1.9.2.
  • middleware is a comma-separated list under one key, sorted and without duplicates. Known tokens are listed in a table, starting with oauth-protected-resource; libraries may supply their own.

The parameters are appended in order, as ; key=value, in a single header. Custom keys are also supported, using ASCII letters, digits, underscores or hyphens. SDK-owned keys are reserved even when absent from the header; reserved keys and duplicates are checked case-insensitively.

Example

X-Client-Info: supabase-js/2.0.0; runtime=node; runtime-version=22.23.4; via=supabase-server/1.9.2; middleware=oauth-protected-resource

Why

@supabase/server needs to identify itself in X-Client-Info without replacing the SDK's own parameters, so that usage from MCP servers can be queried in gateway logs and the warehouse.

The supabase-js implementation is in supabase/supabase-js#2887.

Additional notes

The spec changes land before the supabase-js PR merges.

AI-assisted generated summary

Written with Claude Code and reviewed by me.

Files: specs/client/observability/client_info.md (parameters table, "Library-supplied parameters" and "Errors" sections) and capabilities/client.yaml (description).

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Documentation
    • Clarified how application overrides and library-supplied parameters affect the X-Client-Info header.
    • Expanded the documented parameter format, including key validation, uniqueness, encoding, and handling of existing header values.
    • Documented conventions for via and middleware, and added errors for invalid library parameters.

The client info specification now documents expanded parameter key rules, the via and middleware parameters, and how libraries append parameters to the X-Client-Info value. It clarifies application overrides, reserved keys, value trimming and encoding, header casing, client-creation errors, and parameter parsing. The capability description also states that libraries built on the SDK can append parameters.

Possibly related PRs

  • supabase/sdk#340: Defines the X-Client-Info header format and specification that this change extends.

Change: Feature

Merge Risk: Minimal · up to 5e94e

This PR documents how libraries append via and middleware parameters to X-Client-Info. It changes no runtime behavior, and no merge-blocking risk was identified.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 13211885-1a73-477a-8645-55ee1b61f73e
Commits

Reviewing files that changed from the base of the PR and between 16c8713 and 5e94e1a.

Files selected for processing: 2

  • packages/capability-matrix/capabilities/client.yaml
  • packages/capability-matrix/specs/client/observability/client_info.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@yannbf yannbf self-assigned this Nov 23, 2026
@yannbf
yannbf force-pushed the yannbraga/sdk-1877-client-info-library-parameters branch 2 times, most recently from 9690494 to ff8848e Compare November 23, 2026 18:29
Adds the via and middleware parameters to the X-Client-Info spec and defines
how a library built on an SDK appends them to the SDK's value.

Refs SDK-1877

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@yannbf
yannbf force-pushed the yannbraga/sdk-1877-client-info-library-parameters branch from ff8848e to 6fb1ef3 Compare November 23, 2026 18:41
@yannbf
yannbf marked this pull request as ready for review November 24, 2026 10:16
@yannbf
yannbf requested a review from a team as a code owner November 24, 2026 10:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants